/*
 * @Author: tcosfish
 * @Date: 2022-07-25 09:31:53
 * @LastEditors: tcosfish
 * @LastEditTime: 2022-08-18 11:32:27
 * @FilePath: \loadFile\src\database\entities\SubjectBalance.ts
 */

import {
  Column,
  CreateDateColumn,
  Entity,
  PrimaryColumn,
  UpdateDateColumn,
} from "typeorm"

@Entity()
export class SubjectBalance {
  @PrimaryColumn({ type: "int", comment: "ID" })
  id: number = 0

  @Column({ type: "varchar", comment: "科目代码" })
  code: string = ""

  @Column({ type: "varchar", comment: "科目名称" })
  name: string = ""

  @Column({
    type: "double",
    nullable: true,
    comment: "本期借方发生额",
  })
  debit_amount?: number = 0

  @Column({
    type: "double",
    nullable: true,
    comment: "本期贷方发生额",
  })
  credit_amount: number = 0

  @Column({
    type: "double",
    nullable: true,
    comment: "期末借方余额",
  })
  debit_closing_balance?: number = 0.0

  @Column({
    type: "double",
    nullable: true,
    comment: "期末贷方余额",
  })
  credit_closing_balance?: number = 0

  @CreateDateColumn()
  create_time: string = ""

  @UpdateDateColumn()
  update_time: string = ""
}
